import 'package:flutter/material.dart';
import 'package:flutter_module/page/Engineering/engineering_query.dart';
import 'package:flutter_module/page/Engineering/gongchengguanli.dart';
import 'package:flutter_module/widget/tap_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'Engineering/chuliliucheng.dart';
import 'Engineering/dongchengfenxi.dart';
import 'amap.dart';
class EmergencyPage extends StatefulWidget {
  @override
  _EmergencyPageState createState() => _EmergencyPageState();
}

class _EmergencyPageState extends State<EmergencyPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: TapAppBar(
          TapViewBar(
             Text("抢险工程"),
           ),
        Size.fromHeight(ScreenUtil().setHeight(80))
      ),
      body: Column(
        children: <Widget>[
          InkWell(
            onTap: (){
              Navigator.of(context).push( MaterialPageRoute(builder: (context)=>EngineeringQuery()));
            },
            child:getItem("images/emergency/q1.png", "工程查询")
          ),
          InkWell(
              onTap: (){
                Navigator.of(context).push( MaterialPageRoute(builder: (context)=>GongChengGuanLi()));
              },
              child:getItem("images/emergency/q2.png", "工程管理")
          ),
          InkWell(
              onTap: (){
                  Navigator.of(context).push( MaterialPageRoute(builder: (context)=>JsonEngineeringQuery()));
              },
              child:getItem("images/emergency/q3.png", "工程分析")
          ),
          InkWell(
              onTap: (){
                Navigator.of(context).push( MaterialPageRoute(builder: (context)=>GongChengLiuCheng()));
              },
              child:getItem("images/emergency/q4.png", "处理流程")
          ),
          InkWell(
              onTap: (){
                Map<String,String> map = new Map();
//                Navigator.of(context).push( MaterialPageRoute(builder: (context)=>AmapPage(map)));
              },
              child:getItem("images/emergency/q5.png", "调度视窗")
          ),

    //      getItem(icon, title),getItem(icon, title),getItem(icon, title),getItem(icon, title),


        ],
      ),
    );
  }
//  Widget getItem(String icon,String title){
//    return Container(
//      alignment: Alignment.center,
//      height: ScreenUtil().setHeight(120),
//      margin: EdgeInsets.only(left: 50),
//      decoration: BoxDecoration(
//        border: Border(bottom:BorderSide(
//          width: 1,color: Colors.black12
//        ))
//      ),
//      child: ListTile(
//      leading: Image.asset(icon),
//      title: Text(title),
//      trailing: IconButton(icon: Icon(Icons.arrow_forward_ios), onPressed: null),
//      ),
//    );
//  }
  Widget getItem(String icon, String title) {
    return Container(
      alignment: Alignment.centerLeft,
      height: ScreenUtil().setHeight(100),
      margin: EdgeInsets.only(left: 20),
      decoration: BoxDecoration(
          border: Border(bottom: BorderSide(
              width: 1, color: Colors.black12
          ))
      ),
      child: ListTile(
        leading: Image.asset(icon, width: ScreenUtil().setWidth(60),height: ScreenUtil().setHeight(60),),
        title: Text(title),
        trailing: IconButton(
            icon: Icon(Icons.keyboard_arrow_right), onPressed: null),
      ),
    );
  }
}
